package dao;



import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class checkinfodao {

	public static boolean checkemail(String email){

		String RULE_EMAIL="^[0-9][0-9]{9}(@qq.com)|(163.com)$";
		Pattern p = Pattern.compile(RULE_EMAIL);
		//正则表达式的匹配器
		Matcher m = p.matcher(email);
		return m.matches();
	}
	public static boolean checktel(String tel){

		String teleplement="^1(3|5|7|8|9)[0-9]{9}$";
		Pattern p = Pattern.compile(teleplement);
		//正则表达式的匹配器
		Matcher m = p.matcher(tel);
		return m.matches();

	}

	public static boolean checkname(String name){
		String teleplement="^\\w{2,4}$";
		Pattern p = Pattern.compile(teleplement);
		//正则表达式的匹配器
		Matcher m = p.matcher(name);
		return m.matches();
	}
	public static boolean checkpass(String pass){


		CharSequence a="@";
		CharSequence b="#";
		boolean f=pass.contains(a)||pass.contains(b);
		String teleplement="^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*).{5,10}$";
		Pattern p = Pattern.compile(teleplement);
		//正则表达式的匹配器
		Matcher m = p.matcher(pass);


		return f&m.matches();
	}

	public static void main(String[] args) {
		System.out.println(checkpass("aaaW1aa@#"));
	}

}
